﻿using System;
using BusinessObjects;
using BusinessObjects.BusinessRules;

namespace BusinessSecurity
{
    /// <summary>
    /// UserMembership
    /// </summary>
    public class Membership : BusinessObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Membership" /> class.
        /// </summary>
        public Membership()
        {
            AddRule(new ValidateId("UserId"));            
        }
        /// <summary>
        /// Gets or sets the user identifier.
        /// </summary>
        /// <value>
        /// The user identifier.
        /// </value>
        public int UserId { get; set; }
        /// <summary>
        /// Gets or sets the created date.
        /// </summary>
        /// <value>
        /// The created date.
        /// </value>
        public DateTime CreateDate { get; set; }
        /// <summary>
        /// Gets or sets the confirmation token.
        /// </summary>
        /// <value>
        /// The confirmation token.
        /// </value>
        public string ConfirmationToken { get; set; }
        /// <summary>
        /// Gets or sets a value indicating whether [is confirmed].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [is confirmed]; otherwise, <c>false</c>.
        /// </value>
        public bool IsConfirmed { get; set; }
        /// <summary>
        /// Gets or sets the last password failure date.
        /// </summary>
        /// <value>
        /// The last password failure date.
        /// </value>
        public DateTime LastPasswordFailureDate { get; set; }
        /// <summary>
        /// Gets or sets the password failures since last success.
        /// </summary>
        /// <value>
        /// The password failures since last success.
        /// </value>
        public int PasswordFailuresSinceLastSuccess { get; set; }
        /// <summary>
        /// Gets or sets the password.
        /// </summary>
        /// <value>
        /// The password.
        /// </value>
        public string Password { get; set; }
        /// <summary>
        /// Gets or sets the password changed date.
        /// </summary>
        /// <value>
        /// The password changed date.
        /// </value>
        public DateTime PasswordChangedDate { get; set; }
        /// <summary>
        /// Gets or sets the password salt.
        /// </summary>
        /// <value>
        /// The password salt.
        /// </value>
        public string PasswordSalt { get; set; }
        /// <summary>
        /// Gets or sets the password verification token.
        /// </summary>
        /// <value>
        /// The password verification token.
        /// </value>
        public string PasswordVerificationToken { get; set; }
        /// <summary>
        /// Gets or sets the password verification token expiration date.
        /// </summary>
        /// <value>
        /// The password verification token expiration date.
        /// </value>
        public DateTime PasswordVerificationTokenExpirationDate { get; set; }
    }
}